package ch08_Swing高级组件;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;

import ch07_GUI编程.BaseFrame;

public class JpanelPhoto {
	public static void main(String[] args) {
		BaseFrame f = new BaseFrame("JpanelPhoto");
		JLabel[] labs = new JLabel[100];
		JPanel p = new JPanel();
		JScrollPane sp = new JScrollPane(p);
		for (int i = 0; i < labs.length; i++) {
			labs[i] = new JLabel();
			labs[i].setIcon(new ImageIcon("images/android.png"));
			p.add(labs[i]);
		}
		f.add(sp);
		f.setSize(1000, 500);
		f.setResizable(false);
		sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
		sp.setLocation(100,100);
		sp.setSize(400,200);
		f.add(sp);
		f.showMe();
	}
}
